home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 21
/
AMIGAplus Sonderheft 21 (1999)(ICP)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
RecentScript
/
Importers
/
MiamiOnlineSearch.rexx
Wrap
OS/2 REXX Batch file
|
1999-08-23
|
3KB
|
110 lines
/*****
$VER: MiamiOnlineSearch.rexx 1.0 (18.04.99)
RecentScript Online Search Importer ©Arndt van der Molen
Miami online support by Detlef Wojtaszkiewicz
RecentScript Importer for online searching the AmiNet
is a MUIRexx subapplication and can not be started directly.
It is called only from RecentScript at the 'Import' button.
This importer delivers the filename of a temporary file with
a maximum of 400 archives matching the search string. The search
string must be entered in the RecentScript GUI in the string gadget.
Thanks:
Thanks to 'bossman^' for his AMSD tool which gives me the
inspiring idea for this importer.
Known 'Bugs':
- Temporary file will not be deleted
- No offline support
*****/
OPTIONS RESULTS
IF ~SHOW('P',MIAMI.1) THEN DO
ADDRESS COMMAND
'run <>nil: MIAMI:MIAMI'
'sys:rexxc/Waitforport MIAMI.1'
END
ADDRESS MIAMI.1
ISONLINE
IF ~RC THEN DO
ONLINE
END
PARSE ARG portname
ADDRESS VALUE portname
MUIM_Busy_Move = '0x80020001'
MUIA_Busy_Speed = '0x80020049'
MUIV_Busy_Speed_Off = 0
maxfound = 400
/* Get search string from RecentScript string gadget */
string ID STR_PATT
pattern = result
IF pattern = "" THEN DO
request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "You must enter a search string in RecentScript"
RETURN
END
IF SHOWLIST(H,'TCP') THEN DO
IF OPEN(writehandle, 'T:RS.temp', 'W') THEN DO
window ID OSWIN TITLE '"AmiNet Online Search "' PORT portname
text ID OSTXT LABEL 'Connect to ftp.wustl.edu...'
object CLASS '"Busy.mcc"' ID OSBUSY
endwindow
IF OPEN(tcphandle, 'TCP:ftp.wustl.edu/1848', 'W') THEN DO
text ID OSTXT LABEL 'Search for "'pattern'"...'
object ID OSBUSY ATTRS MUIA_Busy_Speed MUIV_Busy_Speed_Off
WRITECH(tcphandle, 'max 'maxfound' ; find 'pattern' ; quit' || '0a'x || '0d'x)
text ID OSTXT LABEL 'Retrieve search result...'
DO UNTIL EOF(tcphandle)
method ID OSBUSY MUIM_Busy_Move
line = READLN(tcphandle)
IF LEFT(line,6)='*** No' then leave
WRITELN(writehandle, line)
END
CLOSE(tcphandle)
CLOSE(writehandle)
window ID OSWIN CLOSE
RETURN "T:RS.temp"
END
ELSE DO
request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "Cannot connect to 'ftp.wustl.edu'"
END
window ID OSWIN CLOSE
CLOSE(writehandle)
END
ELSE DO
request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "Cannot open temporary file"
END
END
ELSE DO
request ID RECSCRWIN TITLE '"Importer Error"' GADGETS "_OK" STRING "No TCP/IP found - You must be online!"
END
RETURN